package com.isoft.airportsystem.entity.dao;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.UUID;

@Data
@NoArgsConstructor
public class FlightChangeEvent {  // 变更事件实体类
    private String eventId;        // 事件唯一ID
    private String flightId;       // 关联航班ID
    private String requestId;      // 关联变更申请ID
    private String eventType;      // 事件类型（SUBMIT/REVIEW_APPROVED等）
    private String changeType;     // 变更类型（DELAY, CANCEL, DIVERT, GATE_CHANGE, TIME_ADJUSTMENT）
    private String status;         // 当前状态（与FlightChangeRequest一致）
    private String operator;       // 操作人
    private Date eventTime;        // 事件发生时间
    private String changeData;     // 变更数据（JSON）
    private String message;        // 附加消息

    public FlightChangeEvent(String flightId, String requestId, String eventType,
                             String changeType, String status, String operator,
                             String changeData, String message) {
        this.eventId = UUID.randomUUID().toString();
        this.flightId = flightId;
        this.requestId = requestId;
        this.eventType = eventType;
        this.changeType = changeType;
        this.status = status;
        this.operator = operator;
        this.eventTime = new Date();
        this.changeData = changeData;
        this.message = message;
    }
}